package com.qiang.test14.Service;

import com.qiang.test14.Dao.IteacherDao;
import com.qiang.test14.Factory;
import com.qiang.test14.domain.Teacher;

import java.util.ArrayList;

public class TeacherImpService implements IteacherService {
    IteacherDao itd = Factory.getTeacherDao();

    @Override
    public void addTeacher(Teacher teacher) {
        itd.addTeacher(teacher);

    }

    @Override
    public void deleteTeacher(String id) {

        //根据索引删除
        itd.deleteTeacher(id);

    }

    @Override
    public void updateTeacher(String id, Teacher nerteacher) {
        itd.updateTeacher(id, nerteacher);

    }

    @Override
    public ArrayList<Teacher> findTeacher() {
        ArrayList<Teacher> teacher = itd.findTeacher();
        return teacher;

    }
}
